package com.strange.mdl.module.mdl.controller.admin.user.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.*;
import com.strange.mdl.framework.excel.core.annotations.DictFormat;
import com.strange.mdl.framework.excel.core.convert.DictConvert;
import org.springframework.format.annotation.DateTimeFormat;

import static com.strange.mdl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 用户 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MdlUserRespVO {

    @Schema(description = "用户唯一ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23998")
    @ExcelProperty("用户唯一ID")
    private Integer id;

    @Schema(description = "微信开放ID", example = "21114")
    @ExcelProperty("微信开放ID")
    private String openid;

    @Schema(description = "微信UnionID（用于多应用用户统一）", example = "7797")
    @ExcelProperty("微信UnionID（用于多应用用户统一）")
    private String unionid;

    @Schema(description = "微信登录会话密钥")
    @ExcelProperty("微信登录会话密钥")
    private String sessionKey;

    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("用户名")
    private String username;

    @Schema(description = "法号", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @ExcelProperty("法号")
    private String dharmaName;

    @Schema(description = "密码（建议加密存储）")
    @ExcelProperty("密码（建议加密存储）")
    private String password;

    @Schema(description = "手机号")
    @ExcelProperty("手机号")
    private String phone;

    @Schema(description = "是否激活：0未激活，1激活", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否激活：0未激活，1激活", converter = DictConvert.class)
    @DictFormat("isActive") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer isActive;

    @Schema(description = "是否是会员：0不是，1是")
    @ExcelProperty(value = "是否是会员：0不是，1是", converter = DictConvert.class)
    @DictFormat("isMember") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer isMember;

    @Schema(description = "会员等级（1:普通会员, 2:黄金会员, 3:白金会员等）")
    @ExcelProperty(value = "会员等级（1:普通会员, 2:黄金会员, 3:白金会员等）", converter = DictConvert.class)
    @DictFormat("member_experience_biz_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer memberLevel;

    @Schema(description = "生日时间")
    @ExcelProperty("生日时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern= FORMAT_YEAR_MONTH_DAY)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private Date birthDate;

    @Schema(description = "省份")
    @ExcelProperty("省份")
    private String province;

    @Schema(description = "城市")
    @ExcelProperty("城市")
    private String city;

    @Schema(description = "区县")
    @ExcelProperty("区县")
    private String district;

    @Schema(description = "详细地址")
    @ExcelProperty("详细地址")
    private String detailAddress;

    @Schema(description = "性别:0男，1女")
    @ExcelProperty(value = "性别:0男，1女", converter = DictConvert.class)
    @DictFormat("sex") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer sex;

    @Schema(description = "头像", example = "https://www.iocoder.cn")
    @ExcelProperty("头像")
    private String avatarUrl;

    @Schema(description = "福报")
    @ExcelProperty("福报")
    private Integer totalMerit;

}